package org.activiti.solon.config;

import org.noear.redisx.RedisClient;
import org.noear.solon.annotation.Bean;
import org.noear.solon.annotation.Configuration;
import org.noear.solon.annotation.Inject;
import org.noear.solon.cache.jedis.RedisCacheService;
import org.noear.solon.data.cache.CacheService;

@Configuration
public class CacheConfig {
    @Bean
    public RedisClient redisClient(@Inject("${redis}") RedisClient client) {
        return client;
    }

    @Bean
    public CacheService redisCache(@Inject RedisClient client) {
        return new RedisCacheService(client, 30);
    }
}
